import yaml
import os
from get_path import get_path


class ConfigHandler:
    base_path = get_path()

    yaml_path = os.path.join(base_path, "param", "api.yaml")
    with open(yaml_path, "r", encoding="utf-8") as f:
        cfg = f.read()
    cf = yaml.safe_load(cfg)

    # cf["path"]["test_case"] = os.path.join(base_path, "test_case")

    def get_login_path(self):
        return cf["api"]["login"]

    def get_case_path(self):
        return cf["test_case"]


if __name__ == '__main__':
    cf = ConfigHandler()
    print(cf.cf)
    print(cf.get_login_path())
    # print(cf.get_case_path())
